#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int swap(int a)
{
	int count = 0;
	while (a)
	{
		a = a & (a - 1);
		count++;
	}
	return count;
}

int main()
{
	int num = 0;
	scanf("%d", &num);
	int ret = swap(num);
	printf("%d", ret);
}
